package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.ActivityMember;
import com.ruoyi.system.mapper.ActivityMemberMapper;
import com.ruoyi.system.service.IActivityMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2025-08-04
 */
@Service
public class ActivityMemberServiceImpl implements IActivityMemberService
{
    @Autowired
    private ActivityMemberMapper activityMemberMapper;

    /**
     * 查询【查看单个活动成员】
     *
     * @param id 【单个活动成员】主键
     * @return 【单个活动成员】
     */
    @Override
    public ActivityMember selectActivityMemberById(Long id)
    {
        return activityMemberMapper.selectActivityMemberById(id);
    }

    /**
     * 查询【查看活动成员列表】列表
     *
     * @param activityMember 【成员列表】
     * @return 【活动成员列表】
     */
    @Override
    public List<ActivityMember> selectActivityMemberList(ActivityMember activityMember)
    {
        return activityMemberMapper.selectActivityMemberList(activityMember);
    }

    /**
     * 新增【插入单个活动成员】
     *
     * @param activityMember 【单个活动成员】
     * @return 插入单个活动成员成功数量
     */
    @Override
    public int insertActivityMember(ActivityMember activityMember)
    {
        activityMember.setCreateTime(DateUtils.getNowDate());
        return activityMemberMapper.insertActivityMember(activityMember);
    }

    /**
     * 修改【更新活动成员】
     *
     * @param activityMember 【单个活动成员】
     * @return 结果
     */
    @Override
    public int updateActivityMember(ActivityMember activityMember)
    {
        return activityMemberMapper.updateActivityMember(activityMember);
    }

    /**
     * 批量删除【活动成员】
     *
     * @param ids 需要删除的【活动成员】主键列表（逗号隔开）
     * @return 活动成员
     */
    @Override
    public int deleteActivityMemberByIds(String ids)
    {
        return activityMemberMapper.deleteActivityMemberByIds(Convert.toStrArray(ids));
    }

    @Override
    public int updateActivityMemberStatus(Long activityId, Long userId, int i) {
        return 0;
    }

//    @Override
//    public int updateActivityMemberStatus(Long activityId, Long userId, int i) {
//        return activityMemberMapper.updateActivityMemberStatus(
//                activityId,
//                userId,
//                i);
//    }

    @Override
    public int updateActivityMemberStatus(ActivityMember activityMember) {
        return activityMemberMapper.updateActivityMemberStatus(activityMember);
    }

}
